﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

// -----------------------------------------------------------------------
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------
namespace Cryptography_0912089_0912100
{
    public abstract class CryptoHelper
    {
        public virtual void Encrypt(object input)
        {

        }
        public virtual void Decrypt(object input)
        {

        }

        public virtual String GetDecryptName(String encryptPath, String prefix)
        {
            try
            {
                String filename = "";
                filename = encryptPath.Replace(prefix, "");
//                 String[] partName = Path.GetFileName(encryptPath).Split(prefix.ToCharArray());
//                 filename = partName[0];
//                 for (int i = 1; i < partName.Length && partName[i] != ""; i++)
//                 {
//                     filename = filename + "." + partName[i];
//                 }
                filename = Path.GetFileName(filename);
                return filename;
            }
            catch (System.Exception ex)
            {
                ex.GetBaseException();
                return "";
            } 
        }
    }
}
